﻿using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.DTO;
using mendian;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.UC.订单一览新.订单预览新.service
{
    public class 更改订单收货地址Service
    {
        public static PlainMessageResult post修改地址(String orderId,
            String customerName,String consignee,String mobile,
            String addressProvince,String addressCity,String addressDistrict,String addressDetail, String zipCode
            )
        {
            String url = URL.接口url + "/barcode/updateOrderCommitAddress?orderId=" + orderId;
            if (!String.IsNullOrEmpty(customerName))
            {
                url = url + "&customerName=" + customerName;
            }
            if (!String.IsNullOrEmpty(consignee))
            {
                url = url + "&consignee=" + consignee;
            }
            if (!String.IsNullOrEmpty(mobile))
            {
                url = url + "&mobile=" + mobile;
            }
            if (!String.IsNullOrEmpty(addressProvince))
            {
                url = url + "&addressProvince=" + addressProvince;
            }
            if (!String.IsNullOrEmpty(addressCity))
            {
                url = url + "&addressCity=" + addressCity;
            }
            if (!String.IsNullOrEmpty(addressDistrict))
            {
                url = url + "&addressDistrict=" + addressDistrict;
            }
            if (!String.IsNullOrEmpty(addressDetail))
            {
                url = url + "&addressDetail=" + addressDetail;
            }
            if (!String.IsNullOrEmpty(zipCode))
            {
                url = url + "&zipCode=" + zipCode;
            }
            return
                FunctionHelper.JsonDeserialization<PlainMessageResult>(
                    RestCall.httpGetMethod(
                        url
                        )
                    );
        }
    }
    public class PlainMessageResult
    {
        public String errorCode { get; set; }
        public String errorMessage { get; set; }

        public PlainMessageResult()
        {
            
        }
    }
}
